In [1]:
import IPython.core.display as di

# This line will hide code by default when the notebook is exported as HTML
di.display_html('<script>jQuery(function() {if (jQuery("body.notebook_app").length == 0) { jQuery(".input_area").toggle(); jQuery(".prompt").toggle();}});</script>', raw=True)

# This line will add a button to toggle visibility of code blocks, for use with the HTML export version
di.display_html('''<button onclick="jQuery('.input_area').toggle(); jQuery('.prompt').toggle();">Toggle code</button>''', raw=True)
In [119]:
%load_ext autoreload
%autoreload 2

import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import cufflinks as cf
import plotly.offline as py
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
from IPython.display import HTML
import numpy as np
import seaborn as sns

import os
!pip install folium
import folium
from folium import FeatureGroup, LayerControl, Map, Marker

#! pip install hex_bin_maker
from hex_bin_maker import HexBinMaker
!pip install s3fs
import s3fs


#OI IP
! pip install workalendar
from OFL.base import oi_colors as oic
from proteus_ds import RawObjMsmt
from OFL.base.utils import geom as oi_geom
from OFL.base.dataframe import shapes as oi_pandas





%matplotlib inline
py.init_notebook_mode()
cf.go_offline()
cf.set_config_file(theme='white')
from sklearn import preprocessing
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
Requirement already satisfied: folium in /usr/local/lib/python2.7/site-packages (0.7.0)
Requirement already satisfied: branca>=0.3.0 in /usr/local/lib/python2.7/site-packages (from folium) (0.3.1)
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages (from folium) (2.11.1)
Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from folium) (1.11.0)
Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/site-packages (from folium) (2.9.6)
Requirement already satisfied: numpy in /usr/local/lib/python2.7/site-packages (from folium) (1.12.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/site-packages (from jinja2->folium) (1.0)
lockfile 0.11.0 has requirement pbr!=0.7,<1.0,>=0.6, but you'll have pbr 3.1.1 which is incompatible.
awscli 1.10.32 has requirement rsa<=3.3.0,>=3.1.2, but you'll have rsa 3.4.2 which is incompatible.
awscli 1.10.32 has requirement s3transfer==0.0.1, but you'll have s3transfer 0.1.10 which is incompatible.
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already satisfied: s3fs in /usr/local/lib/python2.7/site-packages (0.2.0)
Requirement already satisfied: botocore in /usr/local/lib/python2.7/site-packages (from s3fs) (1.4.22)
Requirement already satisfied: six in /usr/local/lib/python2.7/site-packages (from s3fs) (1.11.0)
Requirement already satisfied: boto3 in /usr/local/lib/python2.7/site-packages (from s3fs) (1.4.1)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python2.7/site-packages (from botocore->s3fs) (2.7.5)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/local/lib/python2.7/site-packages (from botocore->s3fs) (0.9.2)
Requirement already satisfied: docutils>=0.10 in /usr/local/lib/python2.7/site-packages (from botocore->s3fs) (0.13.1)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.0 in /usr/local/lib/python2.7/site-packages (from boto3->s3fs) (0.1.10)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from s3transfer<0.2.0,>=0.1.0->boto3->s3fs) (3.1.1)
lockfile 0.11.0 has requirement pbr!=0.7,<1.0,>=0.6, but you'll have pbr 3.1.1 which is incompatible.
awscli 1.10.32 has requirement rsa<=3.3.0,>=3.1.2, but you'll have rsa 3.4.2 which is incompatible.
awscli 1.10.32 has requirement s3transfer==0.0.1, but you'll have s3transfer 0.1.10 which is incompatible.
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already satisfied: workalendar in /usr/local/lib/python2.7/site-packages (3.2.1)
Requirement already satisfied: setuptools>=1.0 in /usr/local/lib/python2.7/site-packages (from workalendar) (39.1.0)
Requirement already satisfied: pytz in /usr/local/lib/python2.7/site-packages (from workalendar) (2017.3)
Requirement already satisfied: pyCalverter in /usr/local/lib/python2.7/site-packages (from workalendar) (1.6.1)
Requirement already satisfied: lunardate in /usr/local/lib/python2.7/site-packages (from workalendar) (0.2.0)
Requirement already satisfied: ephem in /usr/local/lib/python2.7/site-packages (from workalendar) (3.7.6.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/site-packages (from workalendar) (2.7.5)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python2.7/site-packages (from python-dateutil->workalendar) (1.11.0)
lockfile 0.11.0 has requirement pbr!=0.7,<1.0,>=0.6, but you'll have pbr 3.1.1 which is incompatible.
awscli 1.10.32 has requirement rsa<=3.3.0,>=3.1.2, but you'll have rsa 3.4.2 which is incompatible.
awscli 1.10.32 has requirement s3transfer==0.0.1, but you'll have s3transfer 0.1.10 which is incompatible.
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
In [5]:
# # Function to Select Workdays
# def selectWorkdays(dataFrame) :
#     dataFrame = dataFrame.loc[(dataFrame.index.weekday_name != 'Sunday') &
#                               (dataFrame.index.weekday_name != 'Saturday')]
#     return dataFrame
# # Function to Select Weekends
# def selectWeekends(dataFrame) :
#     dataFrame = dataFrame.loc[(dataFrame.index.weekday_name == 'Sunday') |
#                               (dataFrame.index.weekday_name == 'Saturday')]
#     return dataFrame
# # Function to Select Sundays
# def selectSundays(dataFrame) :
#     dataFrame = dataFrame.loc[(dataFrame['Weekday'] == 'Sunday')]
#     return dataFrame
# # Calculate Means
# def calculateWeeklyMeans(dataFrame) :
#     dataFrame = dataFrame.resample('W').mean()
#     return dataFrame
# # Calculate Means
# def calculateWeeklySums(dataFrame) :
#     dataFrame = dataFrame.resample('W').sum()
#     return dataFrame
In [6]:
# # Create Function to Help Automate Tasks (Includes Year)
# def cleanDF_Day_Year(dataFrame):
#     # Create a Date column
#     dataFrame['Date'] = dataFrame["month"].map(str) \
#                         + '-' + dataFrame["day"].map(str) \
#                         + '-' + dataFrame['year'].map(str)
#     # Convert to date datatype
#     dataFrame['Date'] = pd.to_datetime(dataFrame['Date'])  
#     # Order by Date
#     dataFrame = dataFrame.sort_values(by='Date')
#     dataFrame['Weekday'] = dataFrame['Date'].dt.weekday_name
#     # Rename Columns
#     dataFrame.rename(
#         columns={
#         'count(DISTINCT ad_id)' : 'Count',
#         'month' : 'Month',
#         'day' : 'Day',
#         'year': 'Year'
#       },
#       inplace=True
#     )
#     # Set index
#     dataFrame = dataFrame.set_index('Date')
#     # Return new Data Frame
#     return dataFrame

img/OI-customer-data-portal-header-photo.png

Peactime Indication and Warning (I&W) Monitoring: Cosmodromes

Landuse/Landcover Classification and Geolocation Observation

Orbital Insight leverages proprietary imagery ingestion and computer vision techniques to analyze land use/land cover (LULC) and change detection at scale. In addition, incorporating geolocation data into our analysis creates a more accurate pattern of life portrayal. This provides a baseline in order to identify future anomalies. For this analysis, cosmodromes in Kazahkstan and Russia are analyzed.

This notebook shows basic data analysis. The data used is acquired via Orbital Insight computer vision algorithms and a large ,structured database of geolocation data. Geolocation and LULC data is generated and observed at scale, which helps an analyst understand what is normal. Therefore, protocols can be put in place to identify anomalies if needed.

Importance:

Near-peer adversaries currently use cosmodromes to launch manned and unmanned rockets into space for exploration, communication, scientific, and other relatively peaceful purposes. Historically, however, these cosmodromes were used to test and potentially fire intercontinental ballistic missiles (ICBM). Monitoring these areas of interest from a high-level peacetime I&W perspective allows for the establishment of a baseline. The AOIs observed have the potential to be used for non-peacetime operations, should geopolitical relationships become volatile. It is, therefore, possible that a change in cosmodrome use would yield a trend change in geolocation and other data outputs. Data can be used to help detect anomalous activity should the use of the cosmodromes take on a more strategic military role.

Baikonur Cosmodrome

The Baikonur Cosmodrome in Kazakhstan is operated by Roscosmos and the Russian Aerospace Forces. It was established in 1955 by the Soviet Union as Scientific Research Test Range No. 5 to test the first ICBM, the R-7 Semyorka. The site has supported many historic flights including the first operational ICBM, the Sputnik 1, Luna 1, and the first manned and orbial flight by Yuri Gagarin.

Due to the fall of the Soviet Union, Russia now has a lease enacted with Kazahkstan until 2050. Launches are ongoing today, supporting trips to the International Space Station (ISS) with Soyuz and Progress spacecraft. The historical use as an ICMB launch facility, along with its current infrasture make Baikonur a candidate for peacetime I&W monitoring should relations between Russian and other governments decline.

In [167]:
# Read Pings - sample

baikonur_all_DF = pd.read_csv("s3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/part-00000-c464dd54-14dd-493c-9682-bb32da2185e9-c000.csv", encoding = 'utf-8')
In [168]:
baikonur_all_DF['Date'] = baikonur_all_DF['date']
baikonur_all_DF = baikonur_all_DF.set_index("date")
baikonur_all_DF.index = pd.to_datetime(baikonur_all_DF.index)
In [9]:
# Read Pings - backfill

baik_v2_all = pd.read_csv("s3://orbital-qubole-output-store/logan/launch/baikonur_v2/data_all/baik_v2/part-00000-a7e47525-9116-48c5-89bc-e57276b2b292-c000.csv", encoding = 'utf-8')
In [10]:
baik_v2_all['Date'] = baik_v2_all['date']
baik_v2_all = baik_v2_all.set_index('date')
baik_v2_all.index = pd.to_datetime(baik_v2_all.index)
In [11]:
vostochny_all_DF = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/vostochny_sample_all.csv", encoding = 'utf-8')
In [12]:
vostochny_all_DF['Date'] = vostochny_all_DF['date']
vostochny_all_DF = vostochny_all_DF.set_index("date")
vostochny_all_DF.index = pd.to_datetime(vostochny_all_DF.index)
In [103]:
vostochny_v2_DF = pd.read_csv("s3://orbital-qubole-output-store/logan/launch/vostochny_v2/vost_v2_csv/vost_v2.csv")
In [104]:
vostochny_v2_DF['Date'] = vostochny_v2_DF['date']
vostochny_v2_DF = vostochny_v2_DF.set_index("date")
vostochny_v2_DF.index = pd.to_datetime(vostochny_v2_DF.index)
In [94]:
plesetsk_all_DF = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/plesetsk_global_backfill.csv", encoding = 'utf-8')
In [95]:
plesetsk_all_DF['Date'] = plesetsk_all_DF['date']
plesetsk_all_DF = plesetsk_all_DF.set_index("date")
plesetsk_all_DF.index = pd.to_datetime(plesetsk_all_DF.index)

Baikonur Geolocation

Observed geolocation data is from January 2016 to October 2018 unless otherwise shown as a sample from 15 June 2018 - 15 July 2018. Observation incorporates total pings and daily unique device counts (DUDC) for both the greater Baikonur Cosmodrome region as well as the individual launchpad "31/6".

In [19]:
# For Plotting, add in a "Count" column (so each entry/geolocation ping is a 1) 
baik_plt1 = baik_v2_all
baik_plt1['Count'] = 1

# Then, groupby date and include 'Count' by sum:
baik_plt1 = baik_plt1.groupby(['Date'])['Count'].sum().reset_index()
In [20]:
data = [
        go.Scatter(
            x=baik_plt1['Date'],
            y=baik_plt1['Count'],
            name='Daily Geolocation',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_GREEN_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_GREEN_HEX),
                          size = 5),
        ),
        go.Scatter(
            x=baik_plt1['Date'],
            y=baik_plt1['Count'].rolling(50).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2),

              ),
go.Scatter(
                    x=['2016-01-29'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
        ),
        go.Scatter(
                    x=['2016-03-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2016-03-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2016-03-18'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyus FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-03-24'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-03-31'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-06-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False),

            go.Scatter(
                    x=['2016-07-07'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False),

            go.Scatter(
                    x=['2016-07-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),  
            go.Scatter(
                    x=['2016-10-19'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-11-17'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-12-01'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-02-22'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-04-20'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-06-08'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-06-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-07-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-07-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-08-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-09-11'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-09-12'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-09-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-10-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-12-17'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-12-26'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Zenit 3F'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-02-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-03-21'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-04-18'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-06-06'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-07-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-11-10'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-11-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
]

layout = go.Layout(
    title = "Timeline of Detections: Baikonur Cosmodrome, Kazakstan",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'Total Pings'),
    shapes = [
        # 1st highlight...
        {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2018-7-8',
            'y0': 0,
            'x1': '2018-7-9',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 0,
            }
        }
    ]
)
                     
fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')

The above graphic is a starting point for interested parties to observe cosmodrome activity and create a baseline from geolocation data. Publicly known launches are shown as dots along the x-axis. The green line indicates daily ping counts while the blue line shows the rolling mean. Overall, it makes sense that ping numbers increase due to an increase of users, apps, and connectivity. More data and/or normalization over an increased timeline is needed to better make assumptions regarding any connection between geolocation data and launch events. Note: the area of these pings includes the town to the south of the Cosmodrome area.

In [23]:
baik_DUDC_v2b = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/baik_v2_DUDC.csv")
In [26]:
# For Plotting, add in a "Count" column (each as 1) and then organize by Date (not the index one), sum by Count:

baikv2_plt = baik_DUDC_v2b
baikv2_plt['Count'] = 1
baikv2_plt = baik_DUDC_v2b.groupby(['utc_date'])['count'].sum().reset_index()
In [27]:
data = [
        go.Scatter(
            x=baikv2_plt['utc_date'],
            y=baikv2_plt['count'],
            name='Daily Unique Device Counts',
            mode = 'lines',
            marker = dict(color=(oic.OI_CHART_GREEN_HEX),
                          size=3),
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 1),

        ),
        go.Scatter(
            x=baikv2_plt['utc_date'],
            y=baikv2_plt['count'].rolling(50).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2),

              ),
go.Scatter(
                    x=['2016-01-29'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
        ),
        go.Scatter(
                    x=['2016-03-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2016-03-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2016-03-18'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyus FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-03-24'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-03-31'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-06-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False),

            go.Scatter(
                    x=['2016-07-07'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False),

            go.Scatter(
                    x=['2016-07-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),  
            go.Scatter(
                    x=['2016-10-19'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-11-17'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2016-12-01'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-02-22'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-04-20'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-06-08'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-06-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-07-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-07-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-08-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-09-11'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-09-12'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-09-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-10-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-12-17'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-12-26'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Zenit 3F'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-02-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-03-21'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-04-18'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-06-06'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-07-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-11-10'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-11-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        
]
layout = go.Layout(
    title = "DUDC and Launches: Baikonur Cosmodrome, Kazakhstan",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'DUDC')
)


fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')

The above chart shows daily unique device counts (DUDC) as opposed to raw pings. Generally the trend increases with time. Like the raw ping count, DUDC hits a high in early July and then declines over the next month and a half. This rapid decline could prompt an analyst to take a closer look at the cosmodrome and/or the types of launches during that time. Regular, large increases and declines in DUDC over time may produce patterns. DUDC and geolocation data helps an analyst understand possible patterns that correlate with launch events.

In [28]:
# Setting variable ranges or "masks" - first, assign one for each week/interval

week1_plt = (baik_plt['Date'] >= '2018-06-15') & (baik_plt['Date'] <= '2018-06-21')
week2_plt = (baik_plt['Date'] >= '2018-06-22') & (baik_plt['Date'] <= '2018-06-28')
week3_plt = (baik_plt['Date'] >= '2018-06-29') & (baik_plt['Date'] <= '2018-07-05')
week4_plt = (baik_plt['Date'] >= '2018-07-06') & (baik_plt['Date'] <= '2018-07-12')
In [29]:
# Then, make new DFs based on these masks

# Then, make new DFs based on these masks

baik_week1_plt = baik_plt.loc[week1_plt]
baik_week2_plt = baik_plt.loc[week2_plt]
baik_week3_plt = baik_plt.loc[week3_plt]
baik_week4_plt = baik_plt.loc[week4_plt]

# EXAMPLE to extract based on the variable ranges or "masks" established before: df = df.loc[mask]_week1_plt = Mat_plt.loc[week1_plt]
In [30]:
# # Add a "week" column for each of the new individual week DFs; NOTE this gives some error messages, but did work

baik_week1_plt['week'] = '2018-06-15 to 2018-06-21'
baik_week2_plt['week'] = '2018-06-22 to 2018-06-28'
baik_week3_plt['week'] = '2018-06-29 to 2018-07-05'
baik_week4_plt['week'] = '2018-07-06 to 2018-07-12'
2018-12-07 18:38:12,606 Job=Unspecified Env=dev Level=WARNING PID=39 Thread=MainThread generic.py:1614 /usr/local/lib/python2.7/site-packages/ipykernel_launcher.py:3: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy


2018-12-07 18:38:12,704 Job=Unspecified Env=dev Level=WARNING PID=39 Thread=MainThread generic.py:1614 /usr/local/lib/python2.7/site-packages/ipykernel_launcher.py:4: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy


2018-12-07 18:38:12,759 Job=Unspecified Env=dev Level=WARNING PID=39 Thread=MainThread generic.py:1614 /usr/local/lib/python2.7/site-packages/ipykernel_launcher.py:5: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy


2018-12-07 18:38:12,812 Job=Unspecified Env=dev Level=WARNING PID=39 Thread=MainThread generic.py:1614 /usr/local/lib/python2.7/site-packages/ipykernel_launcher.py:6: SettingWithCopyWarning:


A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy


In [31]:
# Combine those individual weekly DFs back into a composite, which is now ready for box plot

weeks_combined = [baik_week1_plt, baik_week2_plt, baik_week3_plt, baik_week4_plt]
baik_Weekly_plt = pd.concat(weeks_combined)

This concept can also be displayed on a weekly, aggregated basis. In this manner, the "noise" of individual high/low daily values is reduced and we can take a cleaner look at long-term trending based on the spread of values within a defined temporal interval.

In [75]:
trace0 = go.Box(
    y=baik_Weekly_plt["Count"],
    x=baik_Weekly_plt['week'],
    name='Daily Counts/Ranges',
    marker=dict(
        color=oic.OI_CHART_BLUE_HEX
    )
)

data = [trace0]

layout = go.Layout(
    title = "Baikonur Cosmodrome: Range of Daily Counts, Week-by-Week",
    yaxis=dict(
        title='Geolocation Pings',
        zeroline=False
    ),
    boxmode='group'
)
fig = go.Figure(data=data, layout=layout)
py.iplot(fig)

Data can also be visualized as box plots with error bars to increase analyst awareness. The example above shows analysis shows the Baikonur Cosmodrome as a box plot over one sample month. An initial evaluation of outliers and distribution within quantiles can prove useful as part of a larger analysis of geolocation data.

In [33]:
baikonur_pad_31 = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/baik_global_backfill_pad31.csv", encoding = 'utf-8')
In [34]:
baikonur_pad_31['Date'] = baikonur_pad_31['date']
baikonur_pad_31 = baikonur_pad_31.set_index('date')
baikonur_pad_31.index = pd.to_datetime(baikonur_pad_31.index)
In [35]:
# For Plotting, add in a "Count" column (so each entry/geolocation ping is a 1) 
baik_plt_31 = baikonur_pad_31
baik_plt_31['Count'] = 1

# Then, groupby date and include 'Count' by sum:
baik_plt_31 = baik_plt_31.groupby(['Date'])['Count'].sum().reset_index()
In [77]:
data = [
        go.Scatter(
            x=baik_plt_31['Date'],
            y=baik_plt_31['Count'],
            name='Daily Geolocation',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_GREEN_HEX),
                          size = 5)
        ),
            go.Scatter(
            x=baik_plt_31['Date'],
            y=baik_plt_31['Count'].rolling(10).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
            ),
        go.Scatter(
                    x=['2016-03-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),

            go.Scatter(
                    x=['2016-03-31'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),

            go.Scatter(
                    x=['2016-07-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),  
            go.Scatter(
                    x=['2016-10-19'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-07-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),  
            go.Scatter(
                    x=['2017-10-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-02-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-07-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        ]

layout = go.Layout(
    title = "Timeline of Detections: Pad 31 Area, Baikonur Cosmodrome, Kazakstan",
     xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'Ping Count')
    
)

fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')

Additionally, individual launch pad areas can be examined. As more geolocation data comes online, a better understanding of what normal geolocation data looks like around launch events will take form. Analysts will be able to better identify sharp increases or decreases of pings at a launch pad or other points of interest within the cosmodrome. This could indicate repairs, installation of a rocket, cleanup, or clearing of personnel in an area due to an actual launch taking place. Monitoring just the launchpad as opposed to the launch pad area may also produce more granular results for evaluting launchpad activity. At this time, too little data is available in this region to support that analysis. However, gathering data now still helps illustrate the larger pattern of life picture in the future.

In [37]:
baik_31_v2_DUDC = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/baik_31_v2_DUDC.csv")
In [39]:
# For Plotting, add in a "Count" column (each as 1) and then organize by Date (not the index one), sum by Count:

baik_31v2_plt = baik_31_v2_DUDC
baik_31v2_plt['Count'] = 1
baik_31v2_plt = baik_31_v2_DUDC.groupby(['utc_date'])['count'].sum().reset_index()
In [40]:
data = [
        go.Scatter(
            x=baik_31v2_plt['utc_date'],
            y=baik_31v2_plt['count'],
            name='Daily Unique Device Counts',
            mode = 'lines',
            marker = dict(color=(oic.OI_CHART_GREEN_HEX),
                          size=3),
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 1),

        ),
    go.Scatter(
            x=baik_31v2_plt['utc_date'],
            y=baik_31v2_plt['count'].rolling(10).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
            ),

        go.Scatter(
                    x=['2016-03-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),

            go.Scatter(
                    x=['2016-03-31'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),

            go.Scatter(
                    x=['2016-07-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz U'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),  
            go.Scatter(
                    x=['2016-10-19'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2017-07-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),  
            go.Scatter(
                    x=['2017-10-14'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2.1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-02-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-07-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        
]
layout = go.Layout(
    title = "DUDC and Launches: Pad 31 Area, Baikonur Cosmodrome, Kazakhstan",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'DUDC')
)


fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')
In [42]:
baikonur_pad_31_all = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/baikonur_pad_31_all.csv", encoding = 'utf-8')
In [43]:
baikonur_pad_31_all['Date'] = baikonur_pad_31_all['date']
baikonur_pad_31_all = baikonur_pad_31_all.set_index('date')
baikonur_pad_31_all.index = pd.to_datetime(baikonur_pad_31_all.index)
In [44]:
# For Plotting, add in a "Count" column (so each entry/geolocation ping is a 1) 
baik_plt_31_all = baikonur_pad_31_all
baik_plt_31_all['Count'] = 1

# Then, groupby date and include 'Count' by sum:
baik_plt_31_all = baik_plt_31_all.groupby(['Date'])['Count'].sum().reset_index()
In [45]:
data = [
        go.Scatter(
            x=baik_plt_31_all['Date'],
            y=baik_plt_31_all['Count'],
            name='Daily Geolocation',
            mode = 'lines+markers',
                line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_GREEN_HEX),
                          size = 5)
        ),
       go.Scatter(
            x=baik_plt_31_all['Date'],
            y=baik_plt_31_all['Count'].rolling(10).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
       ),
        go.Scatter(
                x=['2018-07-09'],
                y=[0,0,0,0,0,0,0,0,0,0],
                mode='markers',
                text=[ 'Soyuz 2.1a Launch'
                      ],
                marker = dict(
                color = '#d3d3d3',
                size = 5,
                opacity = 0.0,
                line = dict(
                    color = 'black',
                    width = 2
                    )
                  ),
                  showlegend = False
),
        ]

layout = go.Layout(
    title = "Timeline of Detections: Pad 31 Devices Queried in Region of Baikonur Cosmodrome, Kazakstan",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'Total Pings'),
    shapes = [
        # 1st highlight...
        {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2018-7-8',
            'y0': 0,
            'x1': '2018-7-9',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 0,
            }
        }
    ]
)

fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')

The above chart shows the number of pings in the greater Baikonur area with the same unique ID as devices from the launchpad 31/6 area. The gray column corresponds to a launch event during this three month sample. This type of analysis could be useful in the future to identify if more launchpad workers are arriving and/or staying in the greater Baikonur area as workers. For a more in depth analysis, more data and time is recommended to be evaluated by an analyst to better incorporate into their models.

Hexbin Visualizations

Hexbins can help visualize density of pings for a specific AOI at a designated time range.

In [41]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = '/orbital/use_cases/geolocation/launch/csv/baik_global_backfill_pad31.csv'
# Area WKT
areaWKT = "POLYGON ((63.5491121020030505 46.0054533751012684, 63.5497105775611431 45.9833709414564851, 63.5989185688139571 45.9838792136686152, 63.5980541040969456 46.0049453009976901, 63.5491121020030505 46.0054533751012684))"
# hexbinHeight (Optional)
hexbinHeight = 0.005
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baik_global_backfill_pad31.html")
m
2018-12-07 18:38:18,163 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [0.390 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[41]:

Hexbin geolocation visualization of Launchpad 31/6 area from January 2016 to October 2018

In [86]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/baikonur_geo_31_ad_id_2.csv'
# Area WKT
areaWKT = "POLYGON ((62.7699255133959468 46.2174710571839285, 62.7964011609859298 45.5294775505859803, 63.8912816869880729 45.5004380499589871, 63.9038126754528477 46.2105449775186372, 62.7699255133959468 46.2174710571839285))"
# hexbinHeight (Optional)
hexbinHeight = 0.01
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baikonur_hexbin_31_ad_id.html")
m
2018-12-14 16:33:47,223 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [0.536 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[86]:

Hexbin geolocation visualization of devices found near Launchpad 31/6, queried within Baikonur Cosmodrome area during June to July 2018.

In [87]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/baikonur_geo_20180708.csv'
# Area WKT
areaWKT = "POLYGON ((62.7699255133959468 46.2174710571839285, 62.7964011609859298 45.5294775505859803, 63.8912816869880729 45.5004380499589871, 63.9038126754528477 46.2105449775186372, 62.7699255133959468 46.2174710571839285))"
# hexbinHeight (Optional)
hexbinHeight = 0.005
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baikonur_20180708_ad_id.html")
m
2018-12-14 16:33:58,338 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [2.083 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[87]:

Hexbin geolocation visualization the day before launch from Launchpad 31/6. (Launch took place approximately at midnight 7/9/2018).

In [88]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/baikonur_geo_20180709.csv'
# Area WKT
areaWKT = "POLYGON ((62.7699255133959468 46.2174710571839285, 62.7964011609859298 45.5294775505859803, 63.8912816869880729 45.5004380499589871, 63.9038126754528477 46.2105449775186372, 62.7699255133959468 46.2174710571839285))"
# hexbinHeight (Optional)
hexbinHeight = 0.01
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baikonur_20180709_ad_id.html")
m
2018-12-14 16:34:11,665 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [0.544 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[88]:

Hexbin geolocation visualization on day of launch from Launchpad 31/6. (Launch took place at approximately midnight 7/9/2018).

In [89]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/baikonur_geo_20180710.csv'
# Area WKT
areaWKT = "POLYGON ((62.7699255133959468 46.2174710571839285, 62.7964011609859298 45.5294775505859803, 63.8912816869880729 45.5004380499589871, 63.9038126754528477 46.2105449775186372, 62.7699255133959468 46.2174710571839285))"
# hexbinHeight (Optional)
hexbinHeight = 0.01
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baikonur_20180710_ad_id.html")
m
2018-12-14 16:34:22,713 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [0.545 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[89]:

Hexbin geolocation visualization the day after a lauch from Launchpad 31/6.

In [85]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/part-00000-c464dd54-14dd-493c-9682-bb32da2185e9-c000.csv'
# Area WKT
areaWKT = "POLYGON ((62.7699255133959468 46.2174710571839285, 62.7964011609859298 45.5294775505859803, 63.8912816869880729 45.5004380499589871, 63.9038126754528477 46.2105449775186372, 62.7699255133959468 46.2174710571839285))"
# hexbinHeight (Optional)
hexbinHeight = 0.005
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baikonur_hexbin_example.html")
m
2018-12-14 16:31:15,135 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [2.029 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[85]:

Hexbin total geolocation pings from sample, 15 June 2018 - July 15 2018.

In [47]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/data_all/baikonur_big/raw_data_baikonur_where/part-00000-3aaff734-33a0-4c02-a7b6-ad5b70807a7a-c000.csv'
# Area WKT
areaWKT = "POLYGON((24.51171875 15.600392656844914,45.25390625 15.600392656844914,54.39453125 35.44151716718701,107.83203125 32.52699185370365,134.55078125 54.761782489408304,134.55078125 67.60026283968234,20.99609375 65.79313769307596,4.47265625 46.0569173331609,24.51171875 15.600392656844914))"
# hexbinHeight (Optional)
hexbinHeight = .5
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 5000)
m.save("baikonur_global.html")
m
2018-12-07 18:51:22,676 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [1.346 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[47]:

Hexbin geolocation visualization of pings from devices found near Launchpad 31/6, queried globally. Note the route trends from Moscow and the country of Belarus. Additionally, notice the small amount of pings showing up in China and Egypt.

In [46]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = '/orbital/use_cases/geolocation/launch/csv/baik_v2_all.csv'
# Area WKT
areaWKT = "POLYGON ((62.7699255133959468 46.2174710571839285, 62.7964011609859298 45.5294775505859803, 63.8912816869880729 45.5004380499589871, 63.9038126754528477 46.2105449775186372, 62.7699255133959468 46.2174710571839285))"
# hexbinHeight (Optional)
hexbinHeight = 0.005
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("baikonur_pad_31_all.html")
m
2018-12-07 18:42:21,785 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [3.036 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[46]:

Above shows Hexbin geolocation visualization of Baikonur Cosmodrome area from January 2016 to October 2018. Notice the unique line of pings stretching from the town heading northeast to a launchpad. This group of pings was not previousy visible in the sample. It also appears wider than a road or rail route. The data shows that this trend started in late July 2018 and continued into October 2018. Such a trend would warrant closer inspection from parties interested in this area.

In [132]:
from IPython.display import Image
from IPython.core.display import HTML 
Image(url = "https://www.dropbox.com/s/xf6p58izhf1r6k1/baik_anomaly_pings_route.png?dl=1", width = 1000)
Out[132]:

Above shows the isoloated geolocation pings of interest. As stated, these pings were not originally seen in a previous geolocation sample. In addition, the uniform "streak" of pings does not correspond with any know roads. Future analysis and observation could provide more details into why these pings are there. Theories could include surveyors identifying new launchpad areas or roads, an observation area for viewers watching a launch, or simply a shortcut from town to a work area. Regardless, this group of pings would warrant an analyst to pay closer attention to this area in the future, incorporating other data sources and algorithms such as landuse and/or object detection to gain a more holistic analysis of what is happening. We can also dig deeper in the the unique device IDs of these pings to better understand any trends regarding to their origin or travel pattens.

In [157]:
baik_anomaly_pings = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/baik_backfill_anomaly1.csv")
In [158]:
baik_anomaly_pings['Date'] = baik_anomaly_pings['date']
baik_anomaly_pings = baik_anomaly_pings.set_index('date')
baik_anomaly_pings.index = pd.to_datetime(baik_anomaly_pings.index)
In [159]:
# For Plotting, add in a "Count" column (each as 1) and then organize by Date (not the index one), sum by Count:

baik_anomaly = baik_anomaly_pings
baik_anomaly['Count'] = 1
baik_anomaly = baik_anomaly_pings.groupby(['Date'])['Count'].sum().reset_index()
In [166]:
data = [
        go.Scatter(
            x=baik_anomaly['Date'],
            y=baik_anomaly['Count'],
            name='Daily Geolocation',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_GREEN_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_GREEN_HEX),
                          size = 5),
              ),

        go.Scatter(
                    x=['2018-06-06'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2018-07-09'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Proton M/Briz M'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-11-10'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
            go.Scatter(
                    x=['2018-11-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz FG'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
]

layout = go.Layout(
    title = "Timeline of Detections: Baikonur Ping Anomaly",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'Total Pings'),
)
                     
fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')

From the chart above, it appears that the vast majority of pings for the "anomalous" area took place between launches. This rules out spectators gathering for launches, but still leaves for the possibility for pre-construction or another cosmodrome phenomenon not yet identified.

In [133]:
from IPython.display import Image
from IPython.core.display import HTML 
Image(url = "https://www.dropbox.com/s/puit78dab1ln42w/baik_anomaly_global_avg_zoomout_OSM.png?dl=1", width = 1000)
Out[133]:

Above shows the global query result performed on 1,971 unique device IDs. The unique device IDs used were taken from the isolated stretch of pings identified as requiring further analysis. Not surprisingly, the majority of the IDs observed are in Kazahkstan and Russia. However, pings were also noticed in the United States, Moldova, Uzbekistan, Kyrgystan, and Mongolia. Depending on the geopolitical environment at a specific time, an analyst may weight IDs that have been in certain countries over others, providing a more filtered way of incorporating this data into an analysis product or model. The large scale of the queried geolocation data, along with other forms of data derived from OI, enables an analyst to incorporate commercially available imagery and other data sources into a model/product, without taking away from other high-side resources.

Vostochny Cosmodrome

Likewise, we will visualize the daily patterns of detections on a macro-level for Vostochny Cosmodrome, Russia. Vostochny Cosmodrome is a Russian spaceport in the far east of the country. The intent of this cosmodrome is to eventually reduce the dependency Russia has on the Baikonur Cosmodrome in Kazakhstan. The first launch from Vostochny took place 28 April 2016. Once completed, the cosmodrome is stated to permanently employ ~20,000 people.

Construction started January 2011 after a directive from Vladimir Putin. Since then, the project has been plagued on and off with worker strikes, corruption allegations, embezzlement, and unpaid worker wages.

Nevertheless, launches are beginning to take place more rapidly. Infrastructure, like Baikonur, could also support ICBMs. Beginning to understand comsmodrome pattern of life, peacetime or not, is one step in understanding anomalies in the future should relationships between governments disintegrate.

In [110]:
vost_backfill_plt = vostochny_v2_DF
vost_backfill_plt['Count'] = 1
vost_backfill_plt = vostochny_v2_DF.groupby(['Date'])['Count'].sum().reset_index()
In [ ]:
 
In [111]:
data = [
        go.Scatter(
            x=vost_backfill_plt['Date'],
            y=vost_backfill_plt['Count'],
            name='Daily Geolocation',
            mode = 'lines',
            marker = dict(color=(oic.OI_CHART_GREEN_HEX),
                          size=3),
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 1)
        ),
        go.Scatter(
            x=vost_backfill_plt['Date'],
            y=vost_backfill_plt['Count'].rolling(50).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
              ),
        go.Scatter(
                    x=['2016-04-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a/Volga'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
        ),
        go.Scatter(
                    x=['2018-02-01'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2017-11-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        
]
layout = go.Layout(
    title = "DUDC and Launches: Vostochny Cosmodrome, Russia",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'DUDC'),
    shapes = [
        # 1st highlight...
           {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2016-04-28',
            'y0': 0,
            'x1': '2016-04-30',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 1,
            }
        },
        {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2018-01-31',
            'y0': 0,
            'x1': '2018-02-02',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 1,
            }
        },
            #end hightligh
        {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2017-11-27',
            'y0': 0,
            'x1': '2017-11-29',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 1,
            }
        }
    ]
)


fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')
In [92]:
vostochny_DUDC_v2a = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/vost_DUDC.csv")
In [58]:
# For Plotting, add in a "Count" column (each as 1) and then organize by Date (not the index one), sum by Count:

vost2a_plt = vostochny_DUDC_v2a
vost2a_plt['Count'] = 1
vost2a_plt = vostochny_DUDC_v2a.groupby(['utc_date'])['count'].sum().reset_index()
In [59]:
data = [
        go.Scatter(
            x=vost2a_plt['utc_date'],
            y=vost2a_plt['count'],
            name='Daily Unique Device Counts',
            mode = 'lines',
            marker = dict(color=(oic.OI_CHART_GREEN_HEX),
                          size=3),
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 1)
        ),
        go.Scatter(
            x=vost2a_plt['utc_date'],
            y=vost2a_plt['count'].rolling(50).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
              ),
        go.Scatter(
                    x=['2016-04-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a/Volga'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
        ),
        go.Scatter(
                    x=['2018-02-01'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2017-11-28'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1a/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        
]
layout = go.Layout(
    title = "DUDC and Launches: Vostochny Cosmodrome, Russia",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'DUDC'),
    shapes = [
        # 1st highlight...
           {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2016-04-28',
            'y0': 0,
            'x1': '2016-04-30',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 1,
            }
        },
        {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2018-01-31',
            'y0': 0,
            'x1': '2018-02-02',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 1,
            }
        },
            #end hightligh
        {
            'type': 'rect',
            'layer':'below',
            # x-reference is assigned to the x-values
            'xref': 'x',
            # y-reference is assigned to the plot paper [0,1]
            'yref': 'paper',
            'x0': '2017-11-27',
            'y0': 0,
            'x1': '2017-11-29',
            'y1': 1,
            'fillcolor':oic.OI_DARK_BLUE_HEX,
            'opacity': .5,
            'line': {
                'width': 1,
            }
        }
    ]
)


fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')
In [117]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = "s3://orbital-qubole-output-store/logan/launch/vostochny_v2/vost_v2_csv/vost_v2.csv"
# Area WKT
areaWKT = "POLYGON ((128.0421461086189083 51.9632018755783776, 128.0479949452065114 51.7207241438469723, 128.4675263476964915 51.7221666889935676, 128.4851341303553056 51.9734204989211221, 128.0421461086189083 51.9632018755783776))"
# hexbinHeight (Optional)
hexbinHeight = 0.005
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 900)
m.save("vostochny_hexbin_example.html")
m
2018-12-18 19:11:13,852 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [1.127 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[117]:

Vostochny Landuse Aggregation

Due to the plans for Vostochny to play a larger part in launches due to the expiring lease of Baikonur Cosmodrome in 2050, monitoring the construction is an ideal way to understand the speed and/or delays of such a project. By using proprietary landuse algorithm, analysis can aggregate land cover classes over different time ranges. Additionally, by aquiring this data, change detection can be evaluated to determine additions of new launch infrastructure. The landuse algorithm also simplifies where an analyst should look. In this case, the layout of rail, road, and buildings form a relatively standardized launchpad "shape".

In [126]:
from IPython.display import Image
from IPython.core.display import HTML 
Image(url = "https://www.dropbox.com/s/xxe0ri1cxnskjj6/vost_1S_20151101_2018agg.png?dl=1", width = 1000)
Out[126]:

Site 1S, Vostochny's first operation launchpad is shown above in the top mid/left portion of the map. Note the distinct shape of the launchpad as well as the the road/rail connecting it to other infrastructure.

In [125]:
from IPython.display import Image
from IPython.core.display import HTML 
Image(url = "https://www.dropbox.com/s/1kmijxh09qxan43/vost_newpad_20151101_2018agg.png?dl=1", width = 1000)
Out[125]:

Shown above is an area approximately 25 km west of Site 1S. Preliminary road and building construction, along with other characteristics could indicate the location of another launchpad to be built. The automated classification of roads and buildings can be incorporated into further analysis to detect changes in landcover class over time. This gives a more comprehensive, high-level monitoring process for peacetime I&W AOIs.

Plesetsk Cosmodrome

Plesetk Cosmodrome was established in 1957 and lies 800 km north of Moscow. It too was developed to support R-7 ICBM launches and therefore potentially has infrastructure to support such launches in the future. Plesetsk saw in increase in usage soon after the fall of the Soviet Union due to the Baikonur Cosmodrome being located in another country.

In [96]:
# For Plotting, add in a "Count" column (each as 1) and then organize by Date (not the index one), sum by Count:

plet_plt = plesetsk_all_DF
plet_plt['Count'] = 1
plet_plt = plesetsk_all_DF.groupby(['Date'])['Count'].sum().reset_index()
In [101]:
data = [
        go.Scatter(
            x=plet_plt['Date'],
            y=plet_plt['Count'],
            name='Number of Daily Detections',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_GREEN_HEX),
                          size = 5)
        ),
      go.Scatter(
            x=plet_plt['Date'],
            y=plet_plt['Count'].rolling(50).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
              ),
    go.Scatter(
                    x=['2016-02-07'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
        ),
        go.Scatter(
                    x=['2016-02-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2016-05-29'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
    
           go.Scatter(
                    x=['2016-06-04'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),   
           go.Scatter(
                    x=['2017-05-25'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-06-23'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1v/Volga'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-09-22'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-10-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-12-02'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-03-29'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1v'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-04-25'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-06-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-10-25'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
                  go.Scatter(
                    x=['2018-11-03'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
), 

        ]

layout = go.Layout(
    title = "Timeline of Detections, Plesetsk Cosmodrome, Russia",
        xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'Total Pings'),
)

fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')
In [62]:
plesetsk_v2_DUDC = pd.read_csv("/orbital/use_cases/geolocation/launch/csv/plesetsk_v2_DUDC.csv")
In [64]:
# For Plotting, add in a "Count" column (each as 1) and then organize by Date (not the index one), sum by Count:

plesetsk_DUDC_plt = plesetsk_v2_DUDC
plesetsk_DUDC_plt['Count'] = 1
plesetsk_DUDC_plt = plesetsk_v2_DUDC.groupby(['utc_date'])['count'].sum().reset_index()
In [65]:
data = [
        go.Scatter(
            x=plesetsk_DUDC_plt['utc_date'],
            y=plesetsk_DUDC_plt['count'],
            name='Daily Unique Device Counts',
            mode = 'lines',
            marker = dict(color=(oic.OI_CHART_GREEN_HEX),
                          size=3),
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 1)
        ),
        go.Scatter(
            x=plesetsk_DUDC_plt['utc_date'],
            y=plesetsk_DUDC_plt['count'].rolling(50).mean(),
            name='Rolling Mean',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_DARK_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_DARK_BLUE_HEX),
                          size = 2)
              ),
        go.Scatter(
                    x=['2016-02-07'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
        ),
        go.Scatter(
                    x=['2016-02-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
        go.Scatter(
                    x=['2016-05-29'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
    
           go.Scatter(
                    x=['2016-06-04'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),   
           go.Scatter(
                    x=['2017-05-25'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-06-23'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1v/Volga'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-09-22'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-10-13'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2017-12-02'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-03-29'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1v'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-04-25'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Rokot/Briz KM'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-06-16'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
               go.Scatter(
                    x=['2018-10-25'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
),
                  go.Scatter(
                    x=['2018-11-03'],
                    y=[0,0,0,0,0,0,0,0,0,0],
                    mode='markers',
                    text=[ 'Soyuz 2-1b/Fregat'
                          ],
                    marker = dict(
                    color = '#d3d3d3',
                    size = 5,
                    opacity = 1,
                    line = dict(
                      color = 'black',
                      width = 2
                    )
                  ),
                  showlegend = False
), 
]
layout = go.Layout(
    title = "DUDC and Launches: Plesetsk Cosmodrome, Russia",
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'DUDC'),
    
    
)


fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')
In [90]:
# Hexbin Plotter

# Path to Input CSV
inputCSV = 's3://orbital-qubole-output-store/logan/launch/plesetsk/data_all/plesetsk_big/part-00000-235cee34-607a-48fc-8bd5-23f752bb48f2-c000.csv'
# Area WKT
areaWKT = "POLYGON ((40.4088076930910773 63.0014641255649366, 40.4058824421923291 62.8473149974473202, 40.8728091605966597 62.8480347558318400, 40.8816999323949872 63.0056128930638124, 40.4088076930910773 63.0014641255649366))"
# hexbinHeight (Optional)
hexbinHeight = 0.001
# mapStyle
mapStyle = "OpenStreetMap"
# Read CSV
csv_df = pd.read_csv(inputCSV, encoding = 'utf-8')
# Make Hex Bins Using the Script
hexBinMaker = HexBinMaker(csv_df, areaWKT, hexbinHeight, verbose = False)
hexbinCounts = hexBinMaker.makeHexBins()
# Plot Map
m = hexBinMaker.plotHexBins(hexbinCounts, areaWKT, vmin = 1, vmax = 300)
m.save("plesetsk_hexbin_example.html")
m
2018-12-14 16:34:33,826 Job=Unspecified Env=dev Level=INFO PID=39 Thread=MainThread method_timer.py:37   TIMER [5.219 sec] 'execute_psql_script' args:[['DbProxy(host=db-orbital.dev.orbitalinsight.info, port=5432, dbname=rnd_analytics...', 'temp_sql_file.sql'], []] 
Out[90]:

Hexbin of Plesetsk geolocation data.

Comparative Value

In [114]:
data = [
              go.Scatter(
            x=baik_plt1['Date'],
            y=baik_plt1['Count'],
            name='Daily Geolocation',
            mode = 'lines',
            line = dict(color = (oic.OI_CHART_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_BLUE_HEX),
                          size = 5),
        ),
          go.Scatter(
            x=vost_backfill_plt['Date'],
            y=vost_backfill_plt['Count'],
            name='Daily Geolocation',
            mode = 'lines',
            marker = dict(color=(oic.OI_CHART_GREEN_HEX),
                          size=3),
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 1)
        ),
        go.Scatter(
            x=plet_plt['Date'],
            y=plet_plt['Count'],
            name='Daily Geolocation',
            mode = 'lines',
            line = dict(color = (oic.OI_CHART_LIGHTBLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_LIGHTBLUE_HEX),
                          size = 5)
        )
]

layout = go.Layout(
    title = "Comparative Timeline of Daily Geolocation; Baikonur, Vostochny, Plesetsk Cosmodromes",
    
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'Total Pings'),
)

fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')
In [83]:
data = [
        go.Scatter(
            x=baikv2_plt['utc_date'],
            y=baikv2_plt['count'],
            name='Baikonur DUDC',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_CHART_BLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_BLUE_HEX),
                          size = 5)
        ),
        go.Scatter(
            x=vost2a_plt['utc_date'],
            y=vost2a_plt['count'],
            name='Vostochny DUDC',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_CHART_GREEN_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_GREEN_HEX),
                          size = 5)
        ),
        go.Scatter(
            x=plesetsk_DUDC_plt['utc_date'],
            y=plesetsk_DUDC_plt['count'],
            name='Plesetsk DUDC',
            mode = 'lines+markers',
            line = dict(color = (oic.OI_CHART_LIGHTBLUE_HEX),
                        width = 2),
            marker = dict(color = (oic.OI_CHART_LIGHTBLUE_HEX),
                          size = 5)
        )
]

layout = go.Layout(
    title = "Comparative Timeline of DUDC; Baikonur, Vostochny, Plesetsk Cosmodromes",
    
    xaxis = dict(title = 'Date'),
    yaxis = dict(title = 'DUDC'),
)

fig = go.Figure(data=data, layout=layout)  
py.iplot(fig,filename='cufflinks/line')

To conclude, there are various ways the data could be used to supplement analysis of cosmodrome AOIs. By understanding trends and the geopolitical situation of countries operating these facilities, governments will be better able to identify if or when the use changes from peaceful to adversarial.

img/OI-customer-data-portal-footer.png

PROPRIETARY AND CONFIDENTIAL